<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OpenLoong Dynamics Control: LPF_Fst Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OpenLoong Dynamics Control
   &#160;<span id="projectnumber">v0.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classLPF__Fst-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">LPF_Fst Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>fist order low pass filter  
 <a href="classLPF__Fst.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="LPF__fst_8h_source.html">LPF_fst.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a48bcbd03cf6bc81fdd7a916d24d6c1c5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLPF__Fst.html#a48bcbd03cf6bc81fdd7a916d24d6c1c5">LPF_Fst</a> (double fc, double Ts)</td></tr>
<tr class="memdesc:a48bcbd03cf6bc81fdd7a916d24d6c1c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a new lpf_fst object.  <a href="classLPF__Fst.html#a48bcbd03cf6bc81fdd7a916d24d6c1c5">More...</a><br /></td></tr>
<tr class="separator:a48bcbd03cf6bc81fdd7a916d24d6c1c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca2bc6dae4cbdbe8770d27b23466578f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLPF__Fst.html#aca2bc6dae4cbdbe8770d27b23466578f">setPara</a> (double fc, double Ts)</td></tr>
<tr class="memdesc:aca2bc6dae4cbdbe8770d27b23466578f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the parameter of the low-pass-filter.  <a href="classLPF__Fst.html#aca2bc6dae4cbdbe8770d27b23466578f">More...</a><br /></td></tr>
<tr class="separator:aca2bc6dae4cbdbe8770d27b23466578f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b4ab19af93dc33dbc449ccef47c985f"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLPF__Fst.html#a6b4ab19af93dc33dbc449ccef47c985f">ftOut</a> (double dataIn)</td></tr>
<tr class="memdesc:a6b4ab19af93dc33dbc449ccef47c985f"><td class="mdescLeft">&#160;</td><td class="mdescRight">filter the input data  <a href="classLPF__Fst.html#a6b4ab19af93dc33dbc449ccef47c985f">More...</a><br /></td></tr>
<tr class="separator:a6b4ab19af93dc33dbc449ccef47c985f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>fist order low pass filter </p>
<p>transfer function: H(s) = w_c / (s + w_c) w_c: cutoff angular frequency w_c = 2 \pi f_c</p>
<p>using the backward difference method, time interval is T_s s = (1 - z^{-1}) / T_s \alpha = 1 / (1 + (f_s/(2 \pi f_c))) = T_s / (T_s + 1 / (2 \pi f_c ))</p>
<p>filter result u_o(k) = \alpha * u_i(k) + (1 - \alpha) * u_o(k-1) </p>

<p class="definition">Definition at line <a class="el" href="LPF__fst_8h_source.html#l00024">24</a> of file <a class="el" href="LPF__fst_8h_source.html">LPF_fst.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a48bcbd03cf6bc81fdd7a916d24d6c1c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48bcbd03cf6bc81fdd7a916d24d6c1c5">&#9670;&nbsp;</a></span>LPF_Fst()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LPF_Fst::LPF_Fst </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>fc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>Ts</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Construct a new lpf_fst object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fc</td><td>cutoff frequency </td></tr>
    <tr><td class="paramname">Ts</td><td>discretization time interval </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="LPF__fst_8cpp_source.html#l00017">17</a> of file <a class="el" href="LPF__fst_8cpp_source.html">LPF_fst.cpp</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a6b4ab19af93dc33dbc449ccef47c985f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b4ab19af93dc33dbc449ccef47c985f">&#9670;&nbsp;</a></span>ftOut()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double LPF_Fst::ftOut </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>dataIn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>filter the input data </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dataIn</td><td>data to be filtered </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>double </dd></dl>

<p class="definition">Definition at line <a class="el" href="LPF__fst_8cpp_source.html#l00021">21</a> of file <a class="el" href="LPF__fst_8cpp_source.html">LPF_fst.cpp</a>.</p>

</div>
</div>
<a id="aca2bc6dae4cbdbe8770d27b23466578f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aca2bc6dae4cbdbe8770d27b23466578f">&#9670;&nbsp;</a></span>setPara()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LPF_Fst::setPara </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>fc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>Ts</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the parameter of the low-pass-filter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">fc</td><td>cutoff frequency </td></tr>
    <tr><td class="paramname">Ts</td><td>discretization time interval </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="LPF__fst_8cpp_source.html#l00033">33</a> of file <a class="el" href="LPF__fst_8cpp_source.html">LPF_fst.cpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="LPF__fst_8h_source.html">LPF_fst.h</a></li>
<li><a class="el" href="LPF__fst_8cpp_source.html">LPF_fst.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
